package com.craftplay.dao;

import com.craftplay.model.ScopeInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ScopeInfoMapper {
    @Insert({
        "insert into scope_info (id, main_scope, ",
        "sub_scope)",
        "values (#{id,jdbcType=INTEGER}, #{mainScope,jdbcType=VARCHAR}, ",
        "#{subScope,jdbcType=VARCHAR})"
    })
    int insert(ScopeInfo record);


    @Select({
            "select",
            "id, main_scope, sub_scope",
            "from scope_info"
    })
    List<ScopeInfo> listAll();

    @InsertProvider(type=ScopeInfoSqlProvider.class, method="insertSelective")
    int insertSelective(ScopeInfo record);
}